home *** CD-ROM | disk | FTP | other *** search
- /*
- * @(#)allocate.h 1.3 9/24/87
- */
- #ifndef allocate_h
- #define allocate_h
-
- #ifndef nodes_h
- #include "nodes.h"
- #endif
-
- #ifndef ecTypes_h
- #include "ecTypes.h"
- #endif
-
- #ifndef regdefs_h
- #include "regdefs.h"
- #endif
-
- #define NREGISTERS 16
- #define TEMPORARYREGS ((1 << regs_scratch) | (1 << regs_arg1) |\
- (1 << regs_arg2) | (1 << regs_arg3))
- #define LINKAGEREGS ((1 << regs_pc) | (1 << regs_sp) | (1 << regs_l) |\
- (1 << regs_g) | (1 << regs_b) | (1 << regs_ssp))
- #define NLINKAGEREGS 6
- #define ALLOCATABLEREGS (0xffff & ~LINKAGEREGS & ~TEMPORARYREGS)
- #define MINTEMPORARY regs_scratch
- #define MAXTEMPORARY regs_arg3
- #define MINALLOCATABLE (MAXTEMPORARY + 1)
- #define MAXALLOCATABLE (MINLINKAGE - 1)
- #define MINLINKAGE regs_ssp
-
- #define NALLOCATABLE (MAXALLOCATABLE - MINALLOCATABLE + 1)
-
- typedef unsigned int AllocateKind;
- #define NUMKINDS 7
- #define AK_AttachedGlobal 0
- #define AK_Global 1
- #define AK_AttachedLocal 2
- #define AK_Local 3
- #define AK_Boring 4
- #define AK_Monitor 5
- #define AK_InvokeQueue 6
-
- typedef struct sRAInfo {
- Boolean isAllocated :1;
- Boolean isAttached :1;
- AllocateKind itsKind :7;
- unsigned int unused :24;
- } RAInfo;
-
- typedef struct sAllocationInfo {
- NodePtr scope;
- NodePtr identList;
- NodePtr paramList;
- NodePtr resultList;
- Boolean isDataArea : 1;
- Boolean isActivation : 1;
- Boolean unused : 30;
- RAInfo regs[NALLOCATABLE];
- int parameterSize;
- int resultSize;
- int boringSize;
- int localSize;
- int attachedLocalSize;
- int globalSize;
- int attachedGlobalSize;
- int monitorSize;
- int conditionSize;
- int invokeQueueSize;
- int operationTempSize;
- int operationMaxStack;
- } AllocationInfo, *AllocationInfoPtr;
-
- #define firstInstanceOffset 8
- #define firstLocalOffset 4
- #define firstParameterOffset 12
- extern AllocationInfoPtr fetchAllocationInfo(), allocateAllocationInfo();
- extern void doAllocate(), ATCTToSizeAndKind();
-
- #endif
-